<template>
  <div class="page-content padding-top">
    <list class="von-checkbox">
      <item class="item-icon-right" v-for="(item,index) in arr" @click.native="selectItem(item.sortName,item.sortMode,item.sortTitle,index)">{{item.sortTitle}}<i :class="{'icon ion-ios-checkmark-empty assertive':ind == index}"></i></item>
    </list>
  </div>
</template>
<script>
import { bus } from 'bus.js'
 // ...

  export default {
    data() {
      return {
        arr:[
          {
            sortName:'CAR_STOCK_TIME',
            sortMode:'DESC',
            sortTitle:'最近入库'
          },
          {
            sortName:'CAR_STOCK_TIME',
            sortMode:'ASC',
            sortTitle:'最早入库'
          },
          {
            sortName:'CAR_RETAIL_PRICE',
            sortMode:'DESC',
            sortTitle:'价格最高',
          },
           {
            sortName:'CAR_RETAIL_PRICE',
            sortMode:'ASC',
            sortTitle:'价格最低',
          },          
          {
            sortName:'CAR_LICENCE_DATE',
            sortMode:'ASC',
            sortTitle:'车龄最短',
          },
          {
            sortName:'CAR_MILEAGE',
            sortMode:'ASC',
            sortTitle:'里程最短',
          }
        ],
        ind:0,
      }
    },
    created(){

    },
    methods: {
      selectItem(a,b,c,i){
        this.ind = i;
        bus.$emit('sortJson',{
          sortName:a,
          sortMode:b,
          sortTitle:c
        })     
      }
    }
  }
</script>

